<template>
	<view v-for="(item,index) in datalist" style="margin: 10rpx;">
		<!-- 引用自定义组件 -->
		<CustomTextView 
			:title="item.title" 
			:isTop="item.isTop"			:author="item.author" 
			:comments="item.comments" 
			:time="item.time" 		@click="onCustomViewClick(index)">
		<template v-slot:tips>
			<view class="slotcontent" v-if="item.showSearch" style="margin-top: 25rpx;"><!-- 在datalist中添加属性showSearch:true 可显示出来-->
			    <text>搜索：</text>
			    <text style="border: 1rpx solid #31C5DE;margin-left: 10rpx;border-radius: 15rpx;padding: 2rpx 10rpx;">今日金价</text>
			    <text style="border: 1rpx solid #31C5DE;margin-left: 20rpx;border-radius: 15rpx;padding: 2rpx 10rpx;">精选好物</text>
			 </view>
		</template></CustomTextView>
	</view>
</template>

<script>
	import CustomTextView from "../../../components/cardViewText.vue"
	export default {
		components:{
			CustomTextView
		},
		data() {
			return {
				 datalist: [{						title: "cs饰品价格暴跌，多名大学生集体攻击水泥地",						isTop: true,						author: "游戏新闻",						comments: 999,						time: "2025.10.23"						}, 
						{						title: "三季度全球黄金需求刷新历史纪录，黄金ETF基金高开涨超1%，配置黄金的战略价值依然稳固",						isTop: false,						author: "有连云的报道 ",						comments: 999,						time: "2025.11.01",
						showSearch:true						},
						{
						title: "长江鲟归来！背后是两代人守护三十载的传承",
						isTop: false,
						author: "封面新闻",
						comments: 999,
						time: "2025.11.01",
						
						},
						{
						title: "世界十大洲际导弹中排名第二，东风-5B洲际弹道该不该淘汰了？ ",
						isTop: false,
						author: "搜狐新闻",
						comments: 56,
						time: "2025.11.01",
						
						},
						{
						title: "历时3.5小时！神舟二十一号创交会对接纪录：6名航天员太空会师",
						isTop: false,
						author: "驱动之家 的报道",
						comments: 999,
						time: "2025.11.01",
						
						}]				
			}
		},
		methods: {
			
		}
	}
</script>

<style>
.slotcontent {
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: flex-start;
		text-align: center;
		padding-left: 10px;
		color: #aaf;
		font-size: 20rpx;
	}

	.borderbox {
		margin: 5px;
		border-radius: 5px;
		border: 1px solid gray;

	}
</style>
